/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#ifndef __PQ_Thread_H__
#define __PQ_Thread_H__

#include "PQPrerequisites.h"

//namespace to be PQCore is better?
namespace PQCore
{
	/*Warp platform proviced thread
	*/
	class Thread 
	{
	public :
		enum State 
		{
			Ready,
			Running,
			Exiting,
			Exited
		};

	public:
		Thread() ;
		virtual ~Thread();
	public:
		void start();
		void exit(void* retval=0);
		virtual void stop();
		virtual void run();

	public:
		inline unsigned long getThreadId()
		{
			return _threadId;
		}

		inline State getState()
		{
			return _state;
		}

		inline void setState(State state)
		{
			_state=state;
		}
	protected:
		unsigned long _threadId;
		State _state;

		HANDLE _threadHandle;//should hide platform dependent code
	};

}
#endif
